package com.purchase.manage.mapper;

import com.purchase.manage.damian.Purchase;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

@Mapper
public interface ManagePurchaseMapper {

    //采购员注册前判断是否重复
    int checkUser(Purchase purchase);

    //添加进用户表
    void insertSysUser( Purchase purchase);

    //添加进用户和采购员关系表
    void insertSysUserPurchase(@Param("userid")String userid,@Param("pid") String pid);

    //添加进采购员信息表
    void insertPurchase(Purchase purchase);

    //查找用户表中用户id
    String selectUser(Purchase purchase);

    //添加进权限表
    void insertRoleUser(@Param("userid")String userid);

    //修改员工信息
    int updatePurchase(Purchase purchase);

    //修改密码
    void updatePassword(Purchase purchase);

    //查询 该员工是否存在
    Purchase selectPurchase(@Param("id") String purchaseId);

    Long selectPurchaseByuid(@Param("id")Long userId);

    //创建用户前确认
    int selectCount(@Param("phone") String phone);
}
